package com.yc.bean;

import java.util.logging.Handler;

public class DepartMentManager extends Leader{
    public DepartMentManager(String name) {
        super(name);
    }

    @Override
    public void handleRequest(int leaveDays) {
        if (leaveDays <= 5) {
            System.out.println("部门经理" + this.name + "审批了" + leaveDays + "天假");
            if(random.nextInt(2)==1){
                System.out.println("部门经理" + this.name + "批准了" + leaveDays + "天假");
            } else {
                System.out.println("部门经理" + this.name + "拒绝了" + leaveDays + "天假");
            }
        }else{
            if(this.superior!=null){
                this.superior.handleRequest(leaveDays);
            }
        }
    }
}
